<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class AdminGoodsSalesRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'start_time' => 'required',
            'end_time' => 'required',
            'promate_price' => 'required|numeric',
            'promate_num' => 'required|numeric',
        ];
    }

    public function messages()
    {
        return [
            'start_time.required' => '促销开始时间不能为空',
            'end_time.required' => '促销结束时间不能为空',
            'promate_price.required' => '请填写促销价格',
            'promate_price.numeric' => '请输入合法的促销价格',
            'promate_num.required' => '促销个数不能为空',
            'promate_num.numeric' => '请输入合法的促销个数',
        ];
    }
}
